package com.test.webmanage.service.impl;

import com.test.webmanage.mapper.DeptMapper;
import com.test.webmanage.pojo.Dept;
import com.test.webmanage.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;
    public List<Dept> list() {
        return deptMapper.list();
    }
   public void delete(Integer id){
        deptMapper.delete(id);
   }
   public void add(Dept dept){
        dept.setCreateTime(LocalDateTime.now());
        dept.setUpdateTime(LocalDateTime.now());
        deptMapper.add(dept);
   }
}
